<?php use_stylesheets_for_form($form) ?>
<?php use_javascripts_for_form($form) ?>

<form action="<?php echo url_for('users/'.($form->getObject()->isNew() ? 'create' : 'update').(!$form->getObject()->isNew() ? '?id_user='.$form->getObject()->getIdUser() : '')) ?>" method="post" <?php $form->isMultipart() and print 'enctype="multipart/form-data" ' ?>>
<?php if (!$form->getObject()->isNew()): ?>
<input type="hidden" name="sf_method" value="put" />
<?php endif; ?>
<?php echo $form->renderGlobalErrors() ?>
<span class="nombre-campo">First Name<?php echo $form['name']->renderError() ?>
          <?php echo $form['name'] ?></span><br /><span class="nombre-campo"></span>

<span class="nombre-campo"><?php echo $form['last_name']->renderLabel() ?> <?php echo $form['last_name']->renderError() ?><?php echo $form['last_name'] ?></span><br />

<span class="nombre-campo"><?php echo $form['login']->renderLabel() ?><?php echo $form['login']->renderError() ?><?php echo $form['login'] ?></span><br />

<span class="nombre-campo"><?php echo $form['password']->renderLabel() ?><?php echo $form['password']->renderError() ?><?php echo $form['password'] ?></span><br />

<span class="nombre-campo"><label>Repeat password:</label><input type="password" name="password_repeat" id="user_password_repeat" maxlength="50" /></span><br />

<span class="nombre-campo"><?php echo $form['email']->renderLabel() ?><?php echo $form['email']->renderError() ?><?php echo $form['email'] ?></span><br />

<span class="nombre-campo"><label>Repeat Email:</label> <input type="text" name="email_repeat" id="user_email_repeat" maxlength="70" onfocus="this.autocomplete='off';" /></span><br />

<span class="nombre-campo"><?php echo $form['mobile']->renderLabel() ?><?php echo $form['mobile']->renderError() ?><?php echo $form['mobile'] ?></span><br />

<span class="nombre-campo"><?php echo $form['phone']->renderLabel() ?> <?php echo $form['phone']->renderError() ?><?php echo $form['phone'] ?></span><br />



          <?php echo $form->renderHiddenFields(true) ?>
          
          <input type="submit" value="Save" class="button-enter" onclick="return checkRegister(this.form);" />

      <?php if ($sf_user->isAuthenticated()) :  ?>
        <input type="hidden" name="user[credential]" value="<?php echo $form->getObject()->getCredential() ?>" id="user_credential" />
        <input type="hidden" name="user[id_account]" value="<?php echo $form->getObject()->getIdAccount() ?>" id="user_id_account" />
      <?php else :  ?>
        <input type="hidden" name="user[credential]" id="user_credential" value="3" />
        <?php if ($sf_params->get('companyNameUrl')) : ?>
        <?php $company = Doctrine_Core::getTable('Account')->findOneByCompanyNameUrl($sf_params->get('companyNameUrl')) ?>
        <input type="hidden" name="user[id_account]" value="<?php echo $company->getIdAccount() ?>" id="user_id_account" />
        <?php endif; ?>
        <?php if ($form->getObject()->getIdAccount()) : ?>
        <input type="hidden" name="user[id_account]" value="<?php echo $form->getObject()->getIdAccount() ?>" id="user_id_account" />
        <?php endif; ?>
      <?php endif; ?>
      <input type="hidden" name="profile" value="1" id="profile" />

</form>
